package com.molin.conllectionTest;

import java.util.ArrayList;
import java.util.Collection;

public class myCollectionDemo2 {
    public static void main(String[] args) {
        Collection<String> collection=new ArrayList<>();
        collection.add("abc");
        System.out.println(collection);
        System.out.println(collection.remove("abc"));
        System.out.println(collection.remove("ddd"));
        collection.add("abc");
        boolean r=collection.removeIf((String s)->{return s.length()==3;});
        System.out.println(r);
        collection.clear();
        collection.add("abc");

        System.out.println(collection);
        System.out.println(collection.contains("a"));
        System.out.println(collection.contains("abc"));
        System.out.println(collection.isEmpty());
        collection.clear();
        System.out.println(collection.isEmpty());
        collection.add("abc");
        collection.add("abd");
        collection.add("abf");
        System.out.println(collection.size());

    }
}
